function ret=distance(m1,m2)
 if(m1==m2)
  ret=0;
  return;
 endif
 dm=m1-m2;
 mat=sqrtm(dm'*dm);
 ret=trace(mat);
 ret=real(ret);
endfunction
